package com.mach.platform.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * @since 2019-06-27
 */
@Data
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@Entity
@Table(name = "order_form")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 客户
     */
    @Excel(name = "客户", height = 20, width = 30)
    private String customer;

    /**
     * 编号
     */
    @Excel(name = "客户(代号)", height = 20, width = 30)
    private String number;

    /**
     * 定制号码
     */
    @Excel(name = "定制号码", height = 20, width = 30)
    @Column(name = "order_id", length=20)
    private String orderId;

    /**
     * 排制造量
     */
    @Excel(name = "排制造量", height = 20, width = 30)
    private Integer volume;

    /**
     * 产品大类
     */
    @Excel(name = "产品大类", height = 20, width = 30)
    @Column(name = "product_category", length=20)
    private String productCategory;

    /**
     * 用途
     */
    @Excel(name = "用途", height = 20, width = 30)
    private String purpose;

    /**
     * 布底
     */
    @Excel(name = "布底", height = 20, width = 30)
    private String bodly;

    /**
     * 底布
     */
    @Excel(name = "底布", height = 20, width = 30)
    @Column(name = "bottom_cloth", length=20)
    private String bottomCloth;

    /**
     * 厚度
     */
    @Excel(name = "厚度", height = 20, width = 30)
    private String thickness;

    /**
     * 宽度
     */
    @Excel(name = "宽度", height = 20, width = 30)
    private String width;

    /**
     * 印輪壓紋
     */
    @Excel(name = "印輪壓紋", height = 20, width = 30)
    @Column(name = "printing_wheel_embossing", length=20)
    private String printingWheelEmbossing;

    /**
     * 色号
     */
    @Excel(name = "色号", height = 20, width = 30)
    @Column(name = "color_number", length=20)
    private String colorNumber;

    /**
     * Top coating
     */
    @Excel(name = "Top coating", height = 20, width = 30)
    @Column(name = "top_coating", length=20)
    private String topCoating;

    /**
     * Base coating
     */
    @Excel(name = "Base coating", height = 20, width = 30)
    @Column(name = "base_coating", length=20)
    private String baseCoating;
    /**
     * 色水
     */
    @Excel(name = "色水", height = 20, width = 30)
    @Column(name = "top_coating_color_water", length=20)
    private String topCoatingColorWater;

    /**
     * 後端製程
     */
    @Excel(name = "後端製程", height = 20, width = 30)
    @Column(name = "backend_process", length=20)
    private String backendProcess;

    /**
     * 色号
     */
    @Excel(name = "色号", height = 20, width = 30)
    @Column(name = "color_number2", length=20)
    private String colorNumber2;

    /**
     * Dipping
     */
    @Excel(name = "Dipping", height = 20, width = 30)
    private String dipping;

    /**
     * 色水
     */
    @Excel(name = "色水", height = 20, width = 30)
    @Column(name = "dipping_color_water", length=20)
    private String dippingColorWater;

    /**
     * 訂單錄入時間
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_order_time", length=20)
    private LocalDateTime createOrderTime;

    /**
     * 备料状态
     */
    @Column(name = "backup_status", length=20)
    private Integer backupStatus;

    /**
     * 订单状态(1:完成 2：进行中 3：待处理)
     */
    @Column(name = "order_status", length=20)
    private Integer orderStatus;

    /**
     * 布发送状态（1：已完成 2：进行中 3：待处理）
     */
    @Column(name = "cloth_sending_status", length=20)
    private Integer clothSendingStatus;

    /**
     * 涂布段状态（1：已完成 2：进行中 3：待处理）
     */
    @Column(name = "coating_section_status", length=20)
    private Integer coatingSectionStatus;

    /**
     * 卷取段状态（1：已完成 2：进行中 3：待处理）
     */
    @Column(name = "coiling_section_status", length=20)
    private Integer coilingSectionStatus;

    /**
     * 备料布发送状态（1：已准备 2：未准备）
     */
    @Column(name = "spare_parts_cloth_sending_status", length=20)
    private Integer sparePartsClothSendingStatus;

    /**
     * 备料涂布段状态（1：已准备 2：未准备）
     */
    @Column(name = "spare_parts_coating_section_status", length=20)
    private Integer sparePartsCoatingSectionStatus;

    /**
     * 备料卷取段状态（1：已准备 2：未准备）
     */
    @Column(name = "spare_parts_coiling_section_status", length=20)
    private Integer sparePartsCoilingSectionStatus;


    /**
     * 序号
     */
    @Column(name = "serial_number")
    private Integer serialNumber;

    /**
     * 是否可以操作
     */
    private Integer operation;

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", customer='" + customer + '\'' +
                ", number='" + number + '\'' +
                ", orderId='" + orderId + '\'' +
                ", volume=" + volume +
                ", productCategory='" + productCategory + '\'' +
                ", purpose='" + purpose + '\'' +
                ", bodly='" + bodly + '\'' +
                ", bottomCloth='" + bottomCloth + '\'' +
                ", thickness='" + thickness + '\'' +
                ", width='" + width + '\'' +
                ", printingWheelEmbossing='" + printingWheelEmbossing + '\'' +
                ", colorNumber='" + colorNumber + '\'' +
                ", topCoating='" + topCoating + '\'' +
                ", baseCoating='" + baseCoating + '\'' +
                ", topCoatingColorWater='" + topCoatingColorWater + '\'' +
                ", backendProcess='" + backendProcess + '\'' +
                ", colorNumber2='" + colorNumber2 + '\'' +
                ", dipping='" + dipping + '\'' +
                ", dippingColorWater='" + dippingColorWater + '\'' +
                ", createOrderTime=" + createOrderTime +
                ", backupStatus=" + backupStatus +
                ", orderStatus=" + orderStatus +
                ", clothSendingStatus=" + clothSendingStatus +
                ", coatingSectionStatus=" + coatingSectionStatus +
                ", coilingSectionStatus=" + coilingSectionStatus +
                ", sparePartsClothSendingStatus=" + sparePartsClothSendingStatus +
                ", sparePartsCoatingSectionStatus=" + sparePartsCoatingSectionStatus +
                ", sparePartsCoilingSectionStatus=" + sparePartsCoilingSectionStatus +
                ", serialNumber=" + serialNumber +
                ", operation=" + operation +
                '}';
    }
}
